package traffic;

import java.util.ArrayList;

public class Traffic {

    public static void main(String[] args) {
        Road r = new Road();
        for (int i = 1; i <= 7; i++) {
            r.add();
        }
        r.addArc(0, 1, 0, 20, 100);
        r.addArc(0, 3, 0, 25, 110);
        r.addArc(1, 2, 0, 40, 160);
        r.addArc(2, 5, 0, 20, 100);
        r.addArc(3, 4, 0, 25, 110);
        r.addArc(4, 5, 0, 15, 70);
        r.addArc(5, 4, 0, 20, 100);
        r.addArc(4, 6, 0, 20, 100);
        r.update();
        ArrayList<Integer> path=r.getPath(Integer.parseInt(args[0]), Integer.parseInt(args[1]));
        System.out.println("Оптимальный путь:");
        for(int i=0;i<path.size();i++){
            System.out.print(path.get(i)+" ");
        }
        System.out.println("");
        r.move(path.get(path.size()-1));
    }
}
